<{foreach from=$_input.items item=item}>
<div class="row">
 <div class='row-line'>
    <div class="span-1">
    <span class="opt"><{img app="desktop" src="bundle/delecate.gif"  onclick="remove_row(this)" }></span>
    </div>
    <div class="span-auto span-auto-6">
    <{assign var="id" value=$item[$_input.idcol]}>
    <input type="hidden" name="<{$_input.name}>[]" item_id="<{$item[$_input.idcol]}>" value="<{$item[$_input.idcol]}>">
    <{foreach from=$_input._textcol item=_key}>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <{$item[$_key]}>
    <{/foreach}>
    </div>
    <{if $_input.view}>
        <{include file=$_input.view app=$_input.view_app}>
        <{$env.capture.listBody}>
    <{/if}>
   </div>
</div>
<{/foreach}>

<script>
function remove_row(el){
    var obj=$(el).getParent('.rows-body'),row=$(el).getParent('.row');
    var ipt=obj.getPrevious('.object-select').getElement('input');
    var arr=ipt.value.split(',');var tid=row.getElement('input').value;
    ipt.value=arr.erase(tid);
    $(el).getParent('.row').remove();
};
</script>

